import { createRouter, createWebHistory } from "vue-router";

const routes = [
  {
    path: "/",
    redirect: "/home",
  },
  {
    path: "/",
    name: "Layout",
    component: () => import("../views/page/Layout/index.vue"),
    children: [
      {
        path: "/home",
        name: "home",
        component: () => import("../views/page/Home/index.vue"),
      },
      {
        path: "/about",
        name: "about",
        component: () => import("../views/page/About/index.vue"),
      },
    ],
  },
  {
    path: "/404",
    name: "error-page",
    component: () => import("../views/page/Layout/404.vue"),
  },
];
// const routes = createRouter({
//     history: createWebHistory(import.meta.env.BASE_URL),
// })

export default routes;
